﻿<UserControl x:Class="FM.录音.Views.选项导航"
             xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
             xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
             xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
             xmlns:data="clr-namespace:FM.录音.Data"
             xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
             xmlns:telerik="http://schemas.telerik.com/2008/xaml/presentation"
             xmlns:viewModels="clr-namespace:FM.录音.ViewModels"
             Width="200"
             Margin="5"
             FontSize="18"
             d:DataContext="{d:DesignInstance Type=viewModels:选项导航ViewModel}"
             d:DesignHeight="300"
             d:DesignWidth="300"
             mc:Ignorable="d">
    <Grid>
        <Border BorderBrush="{DynamicResource {x:Static SystemColors.ActiveBorderBrushKey}}"
                BorderThickness="1"
                CornerRadius="5">
            <telerik:RadTreeView ItemsSource="{Binding Model.子}" SelectedItem="{Binding Model.选择项, Mode=TwoWay}">
                <telerik:RadContextMenu.ContextMenu>
                    <telerik:RadContextMenu>
                        <telerik:RadMenuItem Command="{Binding 新增Command}" Header="新增">
                            <telerik:RadMenuItem.Icon>
                                <Path Data="{StaticResource 新增图形数据}"
                                      Fill="{StaticResource 新增按钮颜色}"
                                      Style="{StaticResource 图标右键path}" />
                            </telerik:RadMenuItem.Icon>
                        </telerik:RadMenuItem>
                        <telerik:RadMenuItem Command="{Binding 删除Command}" Header="删除">
                            <telerik:RadMenuItem.Icon>
                                <Path Data="{StaticResource 删除图形数据}"
                                      Fill="{StaticResource 删除按钮颜色}"
                                      Style="{StaticResource 图标右键path}" />
                            </telerik:RadMenuItem.Icon>
                        </telerik:RadMenuItem>
                    </telerik:RadContextMenu>
                </telerik:RadContextMenu.ContextMenu>
                <telerik:RadTreeView.ItemTemplate>
                    <HierarchicalDataTemplate DataType="data:配置树枝1" ItemsSource="{Binding 子}">
                        <Grid>
                            <Grid.ColumnDefinitions>
                                <ColumnDefinition Width="*" />
                                <ColumnDefinition Width="Auto" />
                                <ColumnDefinition Width="Auto" />
                            </Grid.ColumnDefinitions>
                            <TextBlock Text="{Binding Model.名称}" />
                            <Button Grid.Column="1"
                                    Margin="10,0,2,0"
                                    HorizontalAlignment="Right"
                                    VerticalAlignment="Center"
                                    Command="{Binding 树枝命令列表.命令1.命令}"
                                    CommandParameter="{Binding }"
                                    ToolTip="{Binding 树枝命令列表.命令1.提示}">
                                <Path Data="{StaticResource 新增图形数据}"
                                      Fill="{StaticResource 新增按钮颜色}"
                                      Style="{StaticResource 图标右键path}" />
                            </Button>
                            <Button Grid.Column="2"
                                    Margin="2,0"
                                    HorizontalAlignment="Right"
                                    VerticalAlignment="Center"
                                    Command="{Binding 树枝命令列表.命令2.命令}"
                                    CommandParameter="{Binding }"
                                    ToolTip="{Binding 树枝命令列表.命令2.提示}">
                                <Path Data="{StaticResource 删除图形数据}"
                                      Fill="{StaticResource 删除按钮颜色}"
                                      Style="{StaticResource 图标右键path}" />
                            </Button>
                        </Grid>
                    </HierarchicalDataTemplate>
                </telerik:RadTreeView.ItemTemplate>
            </telerik:RadTreeView>
        </Border>
    </Grid>
</UserControl>
